<?php
	$conn = mysql_connect("10.4.14.186:3306", "utG7pJABY6ADD", "p4kVM3WyAeYuz");
	if (!$conn)
	{
		die("数据库连接失败：".mysql_errno());
	}
	mysql_query("set names utf8");
	mysql_select_db("d073c0f801fb94dd9b7e170f4fdf72782", $conn);
	$sql = "CREATE TABLE IF NOT EXISTS user (
					id int(11) NOT NULL auto_increment PRIMARY KEY,
					username varchar(20) NOT NULL,
					password varchar(20) NOT NULL,
					email varchar(50) NOT NULL,
					time datetime NOT NULL,
					count int  NOT NULL
					)
		ENGINE=MyISAM 
		DEFAULT CHARSET=utf8 
		AUTO_INCREMENT=1;";
	mysql_query($sql, $conn);
	$sql = "CREATE TABLE IF NOT EXISTS content (
				id int(11) NOT NULL auto_increment PRIMARY KEY,
				username varchar(20) NOT NULL,
				title varchar(50) NOT NULL,
				content varchar(200) NOT NULL,
				time datetime NOT NULL
				)
				ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1";
	mysql_query($sql);
	function htmltocode($content)
	{
		$content=str_replace("\n","<br>",str_replace(" ","&nbsp;",$content));
		return($content);
	}
?>